/**
 * 
 */
package ar.com.mun.dataGenerators;

import java.io.InputStream;

import ar.com.mun.beans.Expediente;
import ar.com.mun.rowProcessors.ExpedienteAnnotationRowProcessorCommand;

import com.angel.architecture.flex.locator.ObjectLocator;
import com.angel.data.generator.annotations.Generator;
import com.angel.data.generator.annotations.Inject;
import com.angel.data.generator.annotations.importFileProcessorRunner.ImportFileProcessorRunnerBuilder;
import com.angel.data.generator.annotations.inputStream.InputStreamBuilder;
import com.angel.data.generator.user.UserDataGenerable;
import com.angel.io.daos.ProcessorLogDAO;
import com.angel.io.descriptor.FileProcessorDescriptor;
import com.angel.io.processors.commands.impl.ExcelFileProcessorCommand;
import com.angel.io.processors.runners.imports.impl.ImportFileAnnotationProcessorRunner;
import com.angel.io.processors.runners.imports.impl.ImportFileProcessorRunner;

/**
 * @author Guillermo Salazar
 * @since 27/Agosto/2009
 *
 */
@Generator(
		objectClass = Expediente.class,
		dependencies = {},
		daoName = "expedienteDAO",
		pages = {}
)
public class ExpedienteByUserAnnotationDataGenerator implements UserDataGenerable{

	private InputStream inputStream;
	
	@Inject
	private ProcessorLogDAO processorLogDAO;
	
	@ImportFileProcessorRunnerBuilder(fileProcessorDescriptor = FileProcessorDescriptor.class, name = "Importacion Expedientes")
    public ImportFileProcessorRunner prepareImportFileProcessorRunner(FileProcessorDescriptor fileProcessorDescriptor) {
		ImportFileAnnotationProcessorRunner a = new ImportFileAnnotationProcessorRunner(fileProcessorDescriptor, new ExcelFileProcessorCommand(), new ExpedienteAnnotationRowProcessorCommand());
		a.setProcessorLogDAO((ProcessorLogDAO) ObjectLocator.getBeanByName("processorLogDAO"));
        return a;
    }

    @InputStreamBuilder
    public InputStream prepareInputStream() {
        return this.getInputStream();
    }

	/**
	 * @return the inputStream
	 */
	public InputStream getInputStream() {
		return inputStream;
	}

	/**
	 * @param inputStream the inputStream to set
	 */
	public void setInputStream(InputStream inputStream) {
		this.inputStream = inputStream;
	}

	/**
	 * @return the processorLogDAO
	 */
	public ProcessorLogDAO getProcessorLogDAO() {
		return processorLogDAO;
	}

	/**
	 * @param processorLogDAO the processorLogDAO to set
	 */
	public void setProcessorLogDAO(ProcessorLogDAO processorLogDAO) {
		this.processorLogDAO = processorLogDAO;
	}
}
